<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/swiper.min.css">
    <style>
        .swiper-bg {
            background: url(images/bc1.jpg) no-repeat;
            height: 500px;
        }
        
        .swiper-wrapper {
            position: absolute;
            top: 0;
        }
        
        .swiper-slide {
            display: flex;
            justify-content: center;
        }
    </style>
    <script src="js/swiper.min.js"></script>
</head>

<body>
    <div class="swiper-container">
        <div class="swiper-bg" data-swiper-parallax="-5%" data-swiper-parallax-duration="1000"></div>
        <div class="swiper-wrapper">
            <div class="swiper-slide"><img src="images/bc1.jpg" /></div>
            <div class="swiper-slide"><img src="images/bc1.jpg" /></div>
            <div class="swiper-slide"><img src="images/bc1.jpg" /></div>
        </div>
        <div class="swiper-button-prev"></div>
        <!--左箭头。如果放置在swiper-container外面，需要自定义样式。-->
        <div class="swiper-button-next"></div>
        <!--右箭头。如果放置在swiper-container外面，需要自定义样式。-->
        <div class="swiper-pagination"></div>
        <!--分页器。如果放置在swiper-container外面，需要自定义样式。-->
    </div>
    <script>
        var mySwiper = new Swiper('.swiper-container', {
            speed: 300,
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
            pagination: {
                el: '.swiper-pagination',
            },
            loop: true,
            autoplay: true,
            clickable: true,
        })
        mySwiper.params.pagination.clickable = true;
        //此外还需要重新初始化pagination
        mySwiper.pagination.destroy()
        mySwiper.pagination.init()
        mySwiper.pagination.bullets.eq(0).addClass('swiper-pagination-bullet-active');
    </script>
    <script>
    </script>
</body>

</html>